<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/fonts/font-awesome.min.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/appcan.icon.css">
        <link rel="stylesheet" href="css/appcan.control.css">
    </head>
    <body class="um-vp bc-bg" ontouchstart>
        I am the pop view.
    </body>
    <script src="js/appcan.js"></script>
    <script src="js/appcan.control.js"></script>
    </body>
    <script>
        appcan.ready(function() {
            var day1 = parseInt(new Date().valueOf() / 1000);
            var day2 = new Date(day1 * 1000);

            var customTime = parseInt(1426163157);
            var cusDay = new Date(customTime * 1000);

            /*
            document.getElementById("btn1").onclick = function() {
            alert(day1);
            }

            document.getElementById("btn2").onclick = function() {
            alert(day2.toLocaleString());
            }

            document.getElementById("btn3").onclick = function() {
            alert(getLocalTime(day1));
            }

            document.getElementById("btn4").onclick = function() {
            alert(getLocalFormatTime(day1));
            }
            */
            // 当前时间
            alert(day2.getFullYear() + "-" + (day2.getMonth() + 1) + "-" + day2.getDate() + " " + day2.getHours() + ":" + day2.getMinutes() + ":" + day2.getSeconds());

            // 自定义时间
            alert(cusDay.getFullYear() + "-" + (cusDay.getMonth() + 1) + "-" + cusDay.getDate());
           
        });

        function getLocalTime(nS) {
            return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' ');
        }

        /* 同上面函数 */
        function getLocalTimes(nS) {
            return new Date(parseInt(nS) * 1000).toLocaleString().substr(0, 17);
        }

        function getLocalFormatTime(nS) {
            return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
        }

    </script>
</html>
